import { useRef } from "react";


const App = () => {

  const dom = useRef();

  const clickBtn = () => {
    dom.current.style.color = 'red'
  }

  return (
    <>
      <h1 ref={dom}>app</h1>
      <button onClick={clickBtn}>获取dom</button>
    </>
  )
}

export default App;